<div class="popup_body">
    <div class="ui_table">
        <form method="post">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <#if Session['SESSION_KEY_USER'].type == Session['USER_TYPE_PLATFORM'].value>
                        <td width="90" align="right">运营商：</td>
                        <td>
                            <input name="agentId" class="easyui-combotree" editable="false" required="true"
                                   style="width: 184px; height: 28px;"
                                   data-options="url:'${contextPath}/security/basic/agent/tree.htm?',method:'get',onSelect: function(rec){
                                   var url = '${contextPath}/security/hdw/agency/tree.htm?agentId='+rec.id;
                                   $('#agency_id_${pid}').combotree('reload', url);},
                                   onChange:function(){
                                    $('#agency_id_${pid}').combotree('clear');
                                    }
                                    "/>
                        </td>
                    <#elseif Session['SESSION_KEY_USER'].type == Session['USER_TYPE_AGENCY'].value||Session['SESSION_KEY_USER'].type == Session['USER_TYPE_AGENT'].value>
                        <input type="hidden" name="agentId" value="${Session['SESSION_KEY_USER'].agentId}">
                    </#if>
                </tr>
                <tr>
                    <#if Session['SESSION_KEY_USER'].type == Session['USER_TYPE_PLATFORM'].value||Session['SESSION_KEY_USER'].type == Session['USER_TYPE_AGENT'].value>
                        <td width="90" align="right">代理商：</td>
                        <td>
                            <input name="agencyId" class="easyui-combotree" editable="false"
                                   style="width: 184px; height: 28px;" id="agency_id_${pid}"
                                   data-options="<#if Session['SESSION_KEY_USER'].agentId??&&Session['SESSION_KEY_USER'].agentId!=0>url:'${contextPath}/security/hdw/agency/tree.htm?agentId=${Session['SESSION_KEY_USER'].agentId}',</#if>method:'get'"/>
                        </td>
                        <#elseif Session['SESSION_KEY_USER'].type == Session['USER_TYPE_AGENCY'].value>
                        <input type="hidden" name="agencyId" value="${Session['SESSION_KEY_USER'].agencyId}">
                    </#if>

                </tr>
                <tr>
                    <td  width="90" align="right">套餐名称：</td>
                    <td><input id="duration" class="text easyui-validatebox" name="priceName" required="true" ></td>
                </tr>
                <tr>
                    <td align="right">消费类型：</td>
                    <td>
                        <select class="easyui-combobox"  name="activeType" style="width:180px;height: 30px ">
                        <#list ActiveTypeEnum as s>
                            <option value="${s.getValue()}">${s.getName()}</option>
                        </#list>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">套餐类型：</td>
                    <td>
                        <select class="easyui-combobox"  name="type" style="width:180px;height: 30px ">
                        <#list TypeEnum as s>
                            <option value="${s.getValue()}">${s.getName()}</option>
                        </#list>
                        </select>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<div class="popup_btn">
    <button class="btn btn_red ok">确定</button>
    <button class="btn btn_border close">关闭</button>
</div>
<script>
    (function() {
        var pid = '${pid}',
                win = $('#' + pid),
                form = win.find('form');

        win.find('button.ok').click(function() {
            form.form('submit', {
                url: '${contextPath}/security/hdw/exchange_price/create.htm',
                success: function(text) {
                    var json = $.evalJSON(text);
                <@app.json_jump/>
                    if(json.success) {
                        $.messager.alert('提示信息', '操作成功', 'info');
                        win.window('close');
                        edit(json.data);
                    } else {
                        $.messager.alert('提示信息', json.message, 'info');
                    }
                }
            });
        });
        win.find('button.close').click(function() {
            win.window('close');
        });

    })()
</script>
